package com.jucai.pppeiyouclient.utils;

import java.math.BigDecimal;

/**
 * Created by Kuky on 2017-04-26.
 */

public class NumberFormateUtils {
    /**
     * 保留n位小数
     *
     * @param number
     * @param count
     * @return
     */
    public static double getTwoNumber(double number, int count) {
        BigDecimal b = new BigDecimal(number);
        return b.setScale(count, BigDecimal.ROUND_HALF_UP).doubleValue();
    }
}
